Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix-15374][SQL Task]Remove trailing semicolons from a SQL sentence. #15376

Closed
wants to merge 1 commit into from

Conversation

iamcaoxudong
Copy link

@iamcaoxudong iamcaoxudong commented Dec 28, 2023

Purpose of the pull request

resolves #15374

Brief change log

Remove trailing semicolons from a SQL sentence.

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@SbloodyS SbloodyS added bug Something isn't working first time contributor First-time contributor 3.2.1 labels Jan 3, 2024
@SbloodyS SbloodyS added this to the 3.2.1 milestone Jan 3, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (93ea5f6) 38.11% compared to head (bdd0cca) 38.11%.
Report is 7 commits behind head on dev.

❗ Current head bdd0cca differs from pull request most recent head 0b82d76. Consider uploading reports for the commit 0b82d76 to get more accurate results

Files Patch % Lines
...scheduler/plugin/task/sql/utils/SqlSplitUtils.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##                dev   #15376   +/-   ##
=========================================
  Coverage     38.11%   38.11%           
- Complexity     4697     4699    +2     
=========================================
  Files          1300     1300           
  Lines         44778    44778           
  Branches       4800     4799    -1     
=========================================
  Hits          17068    17068           
  Misses        25858    25858           
  Partials       1852     1852           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

sonarcloud bot commented Jan 3, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

39.3% Coverage on New Code (required ≥ 60%)

See analysis details on SonarCloud

@ruanwenjun
Copy link
Member

SqlSplitUtils has been removed, split sql is a complex work, we will use Driud to split sql.

@Test
    void splitAndRemoveComment() {
        List<String> sqls = hiveDatasourceProcessor.splitAndRemoveComment("select * from test1;\nselect * from test2;");
        Assertions.assertEquals(2, sqls.size());
        Assertions.assertEquals("select * from test1", sqls.get(0));
        Assertions.assertEquals("select * from test2", sqls.get(1));
    }

If you have multiple sql, you need to use ;, and Druid will remove ;, if you only have one sql, you don't need to use ;;

@ruanwenjun ruanwenjun added the Waiting for reply Waiting for reply label Jan 30, 2024
@ruanwenjun ruanwenjun closed this Jan 30, 2024
@ruanwenjun ruanwenjun added Waiting for user feedback Waiting for feedback from issue/PR author and removed Waiting for reply Waiting for reply labels Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.1 backend bug Something isn't working first time contributor First-time contributor Waiting for user feedback Waiting for feedback from issue/PR author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [SQL Task]Remove trailing semicolons from a SQL sentence.
4 participants